#include "mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
{
    this->setGeometry(0, 0, 800, 480);

    mPushButton[0] = new QPushButton("窗口换肤1", this);
    mPushButton[0]->setGeometry(300, 200, 80, 40);
    connect(mPushButton[0], &QPushButton::clicked, this, &MainWindow::onCLickListenerOne);
    mPushButton[1] = new QPushButton("窗口换肤2", this);
    mPushButton[1]->setGeometry(300, 200, 80, 40);

    connect(mPushButton[1], &QPushButton::clicked, this, &MainWindow::onCLickListenerTwo);
}

MainWindow::~MainWindow()
{

}

void MainWindow::onCLickListenerOne()
{
    this->setStyleSheet(R"(QMainWindow { background-color: rgba(255, 245, 238, 100%); })");
}

void MainWindow::onCLickListenerTwo()
{
    this->setStyleSheet(R"(QMainWindow { background-color: rgba(238, 122, 233, 100%); })");
}
